#include <stdlib.h>
#include "rosa_queues.h"
#include <stdio.h>


#define T1_STACK_SIZE 0x40
static int t1_stack[T1_STACK_SIZE];
tcb t1_tcb;
#define T3_STACK_SIZE 0x40
static int t3_stack[T3_STACK_SIZE];
tcb t3_tcb;
#define T2_STACK_SIZE 0x40
static int t2_stack[T2_STACK_SIZE];
tcb t2_tcb;
#define T4_STACK_SIZE 0x40
static int t4_stack[T4_STACK_SIZE];
tcb t4_tcb;
#define T3_
#define T5_STACK_SIZE 0x40
static int t5_stack[T5_STACK_SIZE];
tcb t5_tcb;
#define T6_STACK_SIZE 0x40
static int t6_stack[T6_STACK_SIZE];
tcb t6_tcb;


void task1(void)
{
	return;
}
void task4(void)
{
	return;
}
void task3(void)
{
	return;
}
void task2(void)
{
	return;
}
void task5(void)
{
	return;
}
void task6(void)
{
	return;
}

int main()
{

	tcb *temp;	
	ROSA_tcbCreate(&t1_tcb, "tsk1", task1, t1_stack, T1_STACK_SIZE,5);
	ROSA_tcbCreate(&t2_tcb, "tsk2", task1, t2_stack, T2_STACK_SIZE,4);
	ROSA_tcbCreate(&t3_tcb, "tsk3", task3, t3_stack, T3_STACK_SIZE,11);
	ROSA_tcbCreate(&t4_tcb, "tsk4", task4, t4_stack, T4_STACK_SIZE,12);
	ROSA_tcbCreate(&t5_tcb, "tsk5", task5, t5_stack, T5_STACK_SIZE,1);
	ROSA_tcbCreate(&t6_tcb, "tsk6", task6, t6_stack, T6_STACK_SIZE,16);
	ROSA_addToReadyQueue(&t2_tcb);
	ROSA_addToReadyQueue(&t1_tcb);
	ROSA_addToReadyQueue(&t3_tcb);	

	ROSA_addToWaitingQueue(&t4_tcb,20);
	ROSA_addToWaitingQueue(&t5_tcb,10);
	ROSA_addToWaitingQueue(&t6_tcb,5);		
	ROSA_removeFromWaitingQueue();	
	ROSA_removeFromWaitingQueue();	
	
	
	


	temp = waitingQueueHead;


	while(temp != NULL)
	{
		
		printf("%d \n",temp->wakeUpTime);
		temp= temp->nexttcb;		 
	}
	
	printf("\n");
	temp = readyQueueHead;

	while(temp != NULL)
	{
		
		printf("%d \n",temp->priority);
		temp= temp->nexttcb;		 
	}
	

	
	system("pause");

	return 0;

}

